package link.cocoon.blog.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import link.cocoon.common.base.BaseEntity;
import link.cocoon.common.base.Tree;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author Cocoon
 * @since 2020-03-31
 */
@Data
@EqualsAndHashCode( callSuper = true )
@Accessors( chain = true )
@TableName( "blog_category" )
@ApiModel( value = "Category对象", description = "博客分类" )
public class Category extends BaseEntity implements Tree {

  @ApiModelProperty( value = "分类名称" )
  private String name;

  @ApiModelProperty( value = "父类ID" )
  private Long parentId;

  @ApiModelProperty( value = "分类描述" )
  private String remark;

  @JsonIgnore
  @Override
  public String getLabel() {
    return this.name;
  }

  @ApiModelProperty( value = "创建人ID" )
  private Long createBy;
}
